﻿using System;
using System.Collections.Generic;

namespace YJKStatisticTable.AreaTable.StatisticControler
{
	public class HouseSuiteAreaAnalyzeData
	{
		public HouseSuiteAreaAnalyzeData(HouseSuiteAreaAnalyzeData rhs)
		{
			this.m_StatisticalRange = rhs.m_StatisticalRange;
			this.m_Data = rhs.m_Data;
			this.m_SumFooting = rhs.m_SumFooting;
		}

		public HouseSuiteAreaAnalyzeData(string statisticalRange, List<HouseSuiteAreaAnalyzeListBySuite> data, HouseSuiteAreaAnalyzeRowData sumFooting)
		{
			this.m_StatisticalRange = statisticalRange;
			this.m_Data = data;
			this.m_SumFooting = sumFooting;
		}

		public void ToGridCellList(ref int startRowIndex, ref List<CellInfo> cells)
		{
			int colIndex = 0;
			List<int> list = new List<int>();
			int num = 0;
			foreach (HouseSuiteAreaAnalyzeListBySuite houseSuiteAreaAnalyzeListBySuite in this.m_Data)
			{
				foreach (HouseSuiteAreaAnalyzeRowData houseSuiteAreaAnalyzeRowData in houseSuiteAreaAnalyzeListBySuite.m_Data)
				{
					list.Add(startRowIndex + num++);
				}
				list.Add(startRowIndex + num++);
			}
			list.Add(startRowIndex + num);
			List<int> list2 = new List<int>();
			list2.Add(colIndex++);
			cells.Add(new CellInfo(list, list2, this.m_StatisticalRange));
			foreach (HouseSuiteAreaAnalyzeListBySuite houseSuiteAreaAnalyzeListBySuite2 in this.m_Data)
			{
				houseSuiteAreaAnalyzeListBySuite2.ToGridCellList(colIndex, ref startRowIndex, ref cells);
			}
			this.ToGridCellListWidthFooting(colIndex, ref startRowIndex, ref cells);
		}

		private void ToGridCellListWidthFooting(int colIndex, ref int startRowIndex, ref List<CellInfo> cells)
		{
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_SuiteNumbName));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, "--"));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_SuiteUseArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_PublicArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_SuiteArchArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_BalconyArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_SuiteCount));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_SumSuiteArchArea));
			cells.Add(CellInfo.NewSingleCellInfo(startRowIndex, colIndex++, this.m_SumFooting.m_SumSuiteRate));
			startRowIndex++;
		}

		public string m_StatisticalRange;

		public List<HouseSuiteAreaAnalyzeListBySuite> m_Data;

		public HouseSuiteAreaAnalyzeRowData m_SumFooting;
	}
}
